import {GameFrameworkEventArgs} from "../Base/GameFrameworkEventArgs";
import {PlaySoundParams} from "./PlaySoundParams";
import {PlaySoundErrorCode} from "./PlaySoundErrorCode";
import {ReferencePool} from "../Base/ReferencePool/ReferencePool";

export class PlaySoundFailureEventArgs extends GameFrameworkEventArgs{
    get soundGroupName(): string {
        return this._soundGroupName;
    }

    get playSoundParams(): PlaySoundParams {
        return this._playSoundParams;
    }

    get errorCode(): PlaySoundErrorCode {
        return this._errorCode;
    }

    get errorMessage(): string {
        return this._errorMessage;
    }

    get userData() {
        return this._userData;
    }
    get soundAssetName(): string {
        return this._soundAssetName;
    }
    get serialId(): number {
        return this._serialId;
    }
    private _serialId:number;
    private _soundAssetName:string;
    private _soundGroupName:string;
    private _playSoundParams:PlaySoundParams;
    private _errorCode:PlaySoundErrorCode;
    private _errorMessage:string;
    private _userData;


    constructor() {
        super();
        this._serialId = 0;
        this._soundAssetName = null;
        this._soundGroupName = null;
        this._playSoundParams = null;
        this._errorCode = PlaySoundErrorCode.Unknown;
        this._errorMessage = null;
        this._userData = null;
    }

    public static Create(serialId:number,soundAssetName:string,soundGroupName:string,  playSoundParams:PlaySoundParams,  errorCode:PlaySoundErrorCode,  errorMessage:string,  userData):PlaySoundFailureEventArgs{
        let playSoundFailureEventArgs:PlaySoundFailureEventArgs = ReferencePool.Acquire(PlaySoundFailureEventArgs);
        playSoundFailureEventArgs._serialId = serialId;
        playSoundFailureEventArgs._soundAssetName = soundAssetName;
        playSoundFailureEventArgs._soundGroupName = soundGroupName;
        playSoundFailureEventArgs._playSoundParams = playSoundParams;
        playSoundFailureEventArgs._errorCode = errorCode;
        playSoundFailureEventArgs._errorMessage = errorMessage;
        playSoundFailureEventArgs._userData = userData;
        return playSoundFailureEventArgs;
    }






    Clear(): void {
        this._serialId = 0;
        this._soundAssetName = null;
        this._soundGroupName = null;
        this._playSoundParams = null;
        this._errorCode = PlaySoundErrorCode.Unknown;
        this._errorMessage = null;
        this._userData = null;
    }

}